<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<title>登录</title>
<link rel="shortcut icon" href="" type="image/x-icon">
<script type="text/javascript" charset="utf-8"src="${pageContext.request.contextPath}/static/js/jquery.js"></script>
<link rel="stylesheet" charset="utf-8" href="${pageContext.request.contextPath}/static/css/reset.css">
<link rel="stylesheet" charset="utf-8" href="${pageContext.request.contextPath}/static/css/reg.css">
<link rel="stylesheet" charset="utf-8" href="${pageContext.request.contextPath}/static/css/shop-login2.css">
</head>
<body>
	<div class="login_header">
		<div class="header_center clearfix">
			<div class="myfl">
				<a href="index.html"><img src="${pageContext.request.contextPath}/static/img/laqu_logo.png" /></a>
				<span>欢迎登陆</span>
			</div>
			<div class="myfr">
				<a href="index.html">返回首页</a><span></span>
				<a href="javascript:;"class="collection_web">收藏网站</a>
			</div>
		</div>
	</div>
	<div class="login_content clearfix">
		<input type="hidden" id="memberType" value="" />
		<form  method="post">
			<input type="hidden" name="memberType" id="parameter" value="1" />
			<div class="login_box myfr">
				<p class="tabchange clearfix">
					<span class="myfl sign_select" id="usertype">用户登录</span> 
					<em class="myfl"></em> 
					<span class="myfl bor_bottom" id="sellertype">商家登录</span>
				</p>
				<p class="system_error"></p>
				<input type="text" name="nick" value="" placeholder="手机号/用户名" id="username" />
				<p class="username_error"><span>用户名不能为空!</span></p>
				<input type="password" placeholder="登录密码" id="password" name="password" maxlength="16" value="" />
				<p class="password_error"><span>密码不能为空!</span></p>
				<p class="forget_password clearfix"><a href="" class="myfr">忘记密码？</a></p>
				<input type="button" value="立即登录" class="submit_btn">
				<p class="entry_mode clearfix">
					<span class="myfl">你也可以用以下方式登录:</span> 
					<a href="source.html" class="myfr"> <em></em> <i>快速注册</i></a>
				</p>
			</div>
		</form>
	</div>
	<div class="login_bottom">Copright &nbsp;&nbsp;2017杭州bb科技有限公司&nbsp;&nbsp;浙ICP17088888号-1 &nbsp;&nbsp;版权所有</div>
</body>
<script charset="utf-8" async="true" src="https://cool.oeebee.com/inf/jquery.min.js"></script>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8"src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8"src="${pageContext.request.contextPath}/static/js/method.js"></script>
<script type="text/javascript" charset="utf-8"src="${pageContext.request.contextPath}/static/js/login.js"></script>
<script type="text/javascript">

	$(".submit_btn").click(function() {

		var username = $("#username").val();
		var password = $("#password").val();

		if (null == username || "" == username || undefined == username) {
			alert("请输入用户名");
			return;
		}
		if (null == password || "" == password || undefined == password) {
			alert("请输入密码");
			return;
		}
		var param = {"username":username,"password":password};
		
		$.ajax({
            type: "post",
            url: "${pageContext.request.contextPath}/cust/login.action",
            dataType: "json",
            data : {
				param:JSON.stringify(param)
			},
            success: function(data){
            	if(data.code == '200'){
					window.location.href = '${pageContext.request.contextPath}/cust/admin';
				}else{
					alert(data.msg);
				}
            },
            error: function (){
                console.log('请求失败');
            }
        });
	});
</script>

</html>